#include"head.h"

int ReadInformation(Information s[], int n) /*读取*/
{
	FILE*fp;
	fp = fopen("Fname", "rb");
	if (fp == NULL)
 	{
 		printf ("\t文件读取失败！\n");
 		fclose(fp);
 		return 0; 
    }
    
	while((fread(&s[n], sizeof(Information), 1, fp)) != 0)
	{
		n++;
	}
	fclose(fp);
	printf("数据读取完成...\n"); 
	
	return n;
}

int WriteInformation(Information s[], int n) /*写入*/
{
	FILE*fp;
	fp = fopen("Fname", "wb");
	fwrite(s, sizeof(Information)*n, 1, fp);
	fclose(fp);
	printf("数据存储完成,退出程序！\n");
	
	return n;
}